package com.net;

import java.net.InetAddress;

/**
 * @Author : hebad90@163.com
 * @Date : 2014/10/22 19:15
 * @From : javalearn
 */
public class InetAddressTest {
    public static void main(String[] args)throws Exception{
        /*InetAddress[] address = InetAddress.getAllByName("www.taobao.com");
        for(InetAddress a:address){
            System.out.println(a);
        }*/
        InetAddress a = InetAddress.getByName("www.baidu.com");
        System.out.println(a);
        /*byte[] bs = a.getAddress();
        for(byte b:bs){
            System.out.println(b<0?b+256:b);
        }*/
        /*byte[] b =new byte[]{127,(byte)0,(byte)0,0};
        InetAddress ad = InetAddress.getByAddress(b);
        System.out.println(ad.getHostName());*/
    }
}
